package com.huabo.system.service.impl;


import com.huabo.system.config.DateBaseConfig;
import com.huabo.system.mysql.entity.TblIndustryInnerMySql;
import com.huabo.system.mysql.mapper.TblIndustryInnerMySqlDAO;
import com.huabo.system.oracle.entity.TblIndustryInner;
import com.huabo.system.oracle.mapper.TblIndustryInnerDAO;
import com.huabo.system.service.TblIndustryInnerService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;


@Service("TblIndustryInnerService")
public class TblIndustryInnerServiceImpl implements TblIndustryInnerService {

    @Resource
    private TblIndustryInnerDAO tblIndustryInnerDAO;
    @Resource
    private TblIndustryInnerMySqlDAO tblIndustryInnerMySqlDAO;

    @Override
    public List<TblIndustryInner> findByList(String hyid) {
        return this.tblIndustryInnerDAO.findByList(hyid);
    }

    @Override
    public List<TblIndustryInnerMySql> findByMySqlList(String hyid) {
        return this.tblIndustryInnerMySqlDAO.findByList(hyid);
    }


    @Override
    public void save(TblIndustryInner industryInner) {
        tblIndustryInnerDAO.saveTblIndustryInner(industryInner);
    }

    @Override
    public void saveMySql(TblIndustryInnerMySql ii) {
        tblIndustryInnerMySqlDAO.saveTblIndustryInner(ii);
    }

    @Override
    public void delete(TblIndustryInner ii) {
        tblIndustryInnerDAO.deleteBYii(ii);
    }

    @Override
    public void deleteMySql(TblIndustryInnerMySql ii) {
        tblIndustryInnerMySqlDAO.deleteBYii(ii);
    }

    @Override
    public void deleteByOrgid(BigDecimal orgid) {
        if (DateBaseConfig.DATABASETYPE.equals("Oracle")) {
            tblIndustryInnerDAO.deleteByOrgid(orgid);
        } else {
            tblIndustryInnerMySqlDAO.deleteByOrgid(orgid);
        }
    }
}
